const person = {
    name: 'zce',
    age: 20
}

const personProxy = new Proxy(person, {
    get (target, property) {
        console.log(target, property);
        console.log(target[property]);
        return 100;
    },
    set (target, property,value) {
        if(property === 'age') {
            if(!Number.isInteger(value)){
                throw new TypeError("Wrong type");
            }
        }

        target[property] = value;
    }
})

personProxy.age = 100;
personProxy.gender = true;

console.log(personProxy.name);
console.log(personProxy.xxx);